<%--
$Id: article-list.jsp 13 2010-11-02 15:35:59Z feigme $
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/content/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>List Article</title>
</head>
<body>
<%@ include file="article-menu.jsp" %>
<table width="100%" class="solidtable">
    <tr>
        <td class="solidtr" width="30" align="center">
        	<a href="${ctx }/admin/article/list/<c:out value="${articlesPage.pageNo}" />?sort=id"><fmt:message key="common.id"/></a>
        </td>
        <td class="solidtr" ><fmt:message key="article.title"/></td>
        <td class="solidtr" ><fmt:message key="article.category.name"/></td>
        <td class="solidtr" ><fmt:message key="article.comment.count"/></td>
        <td class="solidtr" ><fmt:message key="article.last.update.date"/></td>
        <td class="solidtr" align="center"><fmt:message key="common.action"/></td>
    </tr>
    <c:forEach var="art" items="${articlesPage.result}">
    <tr>
        <td align="center"><c:out value="${art.id}"/></td>
        <td>
        	<a href="${ctx }/admin/article/<c:out value="${art.id}"/>" title="<c:out value="${art.title}"/>" target="_blank">
        		<c:out value="${art.title}"/>
        	</a>
        </td>
        <td><c:out value="${art.category.name}"/></td>
        <td><c:out value="${art.commentCount}"/></td>
        <td>
			<fmt:formatDate value="${art.lastUpdateDate}" pattern="yyyy-MM-dd HH:mm:ss" />
		</td>
        <td align="center">
        	<a href="#"><fmt:message key="common.config"/></a>
        	<a href="${ctx }/admin/article/<c:out value="${art.id}"/>/edit"><fmt:message key="common.update"/></a>
        </td>
    </tr>
    </c:forEach>
</table> 
<table>
<tr>
   	<td>
   		<c:if test="${articlesPage.hasPre}"><a href="${ctx }/admin/article/list/<c:out value="${articlesPage.prePage}"/>"><fmt:message key="common.prev"/></a></c:if>
   		<c:if test="${articlesPage.totalPages>1}" >
   		<c:forEach begin="1" var="page" end="${articlesPage.totalPages}">
   			&nbsp;
   			<c:choose>
				<c:when test="${articlesPage.pageNo!=page}">
					<a href="${ctx }/admin/article/list/<c:out value="${page}" />">
						<c:out value="${page}" />
					</a>	
				</c:when>
				<c:otherwise>
					<c:out value="${page}" />
				</c:otherwise>
			</c:choose>
   		</c:forEach>
   		</c:if>
   		<c:if test="${articlesPage.hasNext}">&nbsp;<a href="${ctx }/admin/article/list/<c:out value="${articlesPage.nextPage}" />"><fmt:message key="common.next"/></a></c:if>
   	</td>
    </tr>
</table>   
</body>
</html>
	